package cn.stacey.es;

import java.util.List;
import java.util.function.Consumer;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;


import cn.stacey.es.domain.Product;
import cn.stacey.es.mapper.ProductMapper;

@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:context-dao.xml")
public class testProduct {
	@Autowired
	ProductMapper mapper;
	
	@Test
	public void testfindAll() {
		List<Product> list = mapper.findAll(0, 10);
		list.forEach(new Consumer<Product>() {
			public void accept(Product t) {
				System.out.println(t);
			}

		});
	}
	
	@Test
	public void testgetCount() {
		int count = mapper.getCount();
		System.out.println(count);
		
	}
	
}
